from fastapi import Request


async def get_request_context(request: Request):
    return {
        "ip": request.client.host,
        "user_agent": request.headers.get("user-agent"),
        "headers": dict(request.headers)
    }